<template>
	<view class="moreData dis_f_co_c_c">
		<view class="dis_f_c_c" v-if="props.type=='loading'">
			<image class="icon" src="@/static/components/more-data/loading.png" mode="aspectFit"></image>
			<text>加载中...</text>
		</view>
		<view class="dis_f_c_c" v-if="props.type=='noMore'">
			<image class="no_more" src="@/static/components/more-data/noMore.png" mode="aspectFit"></image>
		</view>
		<view class="dis_f_c_c" v-if="props.type=='noData'">
			<slot></slot>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const props = defineProps(['type'])
</script>

<style lang="scss" scoped>
	.moreData {
		min-height: 90rpx;
		font-size: 24rpx;
		color: #aaa;

		.icon {
			width: 32rpx;
			height: 32rpx;
			margin-right: 10rpx;

			animation: loading 2s linear infinite;
			-o-animation: loading 2s linear infinite;
			-moz-animation: loading 2s linear infinite;
			-webkit-animation: loading 2s linear infinite;
		}

		// 没有更多数据
		.no_more {
			width: 220rpx;
			height: 30rpx;
		}
	}

	@keyframes loading {
		from {
			transform: rotate(0deg)
		}

		to {
			transform: rotate(360deg)
		}
	}

	@-moz-keyframes loading {
		from {
			transform: rotate(0deg)
		}

		to {
			transform: rotate(360deg)
		}
	}

	@-webkit-keyframes loading {
		from {
			transform: rotate(0deg)
		}

		to {
			transform: rotate(360deg)
		}
	}

	@-o-keyframes loading {
		from {
			transform: rotate(0deg)
		}

		to {
			transform: rotate(360deg)
		}
	}
</style>